package com.gws.ievent.common;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @author song
 * @date 2022/10/18 11:22
 */
@Data
@AllArgsConstructor
public class Result<T> {
    private boolean status;
    private int code;
    private String message;
    private T data;


    public static <T> Result<T> success(int code, String message, T data) {
        return new Result<>(true, code, message, data);
    }


    public static Result<Object> success(int code, String message) {
        return success(code, message, null);
    }

    public static Result<Object> fail(int code, String message) {
        return new Result<>(false, code, message, null);
    }

}
